<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <!-- import CSS -->
  <link rel="stylesheet" href="https://cdn.staticfile.org/element-ui/2.15.9/theme-chalk/index.css">
</head>
<body>
<div id="app">
  <el-container>
    <el-header style="background-color: #0095d7">
      <h1 style="color: white;font-size: 22px">
        CoolShark商城后台管理系统
        <span style="float:right;font-size: 15px">欢迎xxx回来!<a href="">退出登录</a></span>
      </h1>
    </el-header>
    <el-container>
      <el-aside width="200px" style="overflow: hidden">
        <!--导航菜单开始-->
        <el-menu>
          <!--添加子菜单-->
          <el-submenu index="1">
            <!--添加子菜单标题-->
            <template slot="title">
              <i class="el-icon-s-flag"></i>
              <span>分类管理</span>
            </template>
            <!--添加菜单项-->
            <el-menu-item index="1-1">分类列表</el-menu-item>
            <el-menu-item index="1-2">添加分类</el-menu-item>
          </el-submenu>

          <el-submenu index="2">
            <!--添加子菜单标题-->
            <template slot="title">
              <i class="el-icon-picture"></i>
              <span>轮播图管理</span>
            </template>
            <!--添加菜单项-->
            <el-menu-item index="2-1">轮播图列表</el-menu-item>
            <el-menu-item index="2-2">添加轮播图</el-menu-item>
          </el-submenu>
          <el-submenu index="3">
            <!--添加子菜单标题-->
            <template slot="title">
              <i class="el-icon-shopping-cart-2"></i>
              <span>商品管理</span>
            </template>
            <!--添加菜单项-->
            <el-menu-item index="3-1">商品列表</el-menu-item>
            <el-menu-item index="3-2">添加商品</el-menu-item>
          </el-submenu>

        </el-menu>
        <!--导航菜单结束-->
      </el-aside>
      <el-main>
        <!--分类表格开始-->
        <el-table :data="categoryArr" style="width: 100%">
          <el-table-column type="index" label="编号" width="180">
          </el-table-column>
          <el-table-column prop="name" label="分类名称" width="180">
          </el-table-column>
          <el-table-column label="操作">
            <template slot-scope="scope">
              <el-button
                      size="mini"
                      type="danger"
                      @click="categoryDelete(scope.$index, scope.row)">删除</el-button>
            </template>
          </el-table-column>
        </el-table>
        <!--分类表格结束-->
        <!--轮播图表格开始-->
        <el-table :data="bannerArr" style="width: 100%">
          <el-table-column type="index" label="编号" width="180">
          </el-table-column>
          <el-table-column  label="轮播图" width="180">
            <!--自定义内容必须写在template里面-->
            <template slot-scope="scope">
              <!--scope.row得到当前行对应的数组里面的对象-->
              <img :src="scope.row.url" width="100%" alt="">
            </template>
          </el-table-column>
          <el-table-column label="操作">
            <template slot-scope="scope">
              <el-button
                      size="mini"
                      type="danger"
                      @click="categoryDelete(scope.$index, scope.row)">删除</el-button>
            </template>
          </el-table-column>
        </el-table>
        <!--轮播图表格结束-->

      </el-main>
    </el-container>
  </el-container>
</div>
</body>
<!-- import Vue before Element -->
<script src="https://cdn.staticfile.org/vue/2.6.14/vue.min.js"></script>
<!-- import JavaScript -->
<script src="https://cdn.staticfile.org/element-ui/2.15.9/index.min.js"></script>
<script>
  let v = new Vue({
    el: '#app',
    data: function () {
      return {
        categoryArr:[{name:"品牌服装"},{name:"精品女装"},
          {name:"美食健康"},{name:"数码科技"},{name:"篮球鞋"}],
        bannerArr:[{url:"imgs/b1.jpg"},{url:"imgs/b2.jpg"},
          {url:"imgs/b3.jpg"}]
      }
    },
    methods: {
      categoryDelete(i,category){

      }
    }
  })
</script>
</html>